package com.sise.wangzhan;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Classname MyController
 * @Description TODO
 * @Date 2020/4/22 21:09
 * @Created by wangzhan
 */
@RestController
public class MyController {

    @GetMapping("/normalHello")
    @ResponseBody
    public String normalHello(HttpServletRequest request){
        return "Hello World";
    }

    @GetMapping("/errorHello")
    @ResponseBody
    public String errorHello(HttpServletRequest request) throws InterruptedException {
        //模拟故障，需要处理10秒
        Thread.sleep(10000);
        return "Error HelloWorld";
    }

}
